{
    {
        int KiviVideoMM_a = 45;
        int KiviVideoMM_b = ceil(KiviVideoMM_a/2.0);
        if(KiviVideoMM_a < KiviVideoMM_b){
            UILabel *selfLab = [[UILabel alloc] init];
            UILabel *truncatingTailView = [[UILabel alloc] init];
            UIEdgeInsets contentEdgeInsets = UIEdgeInsetsZero;
            [selfLab bringSubviewToFront:truncatingTailView];
            // 不能通过修改 numberOfLines = 0 再恢复它的值，来计算高度是否折叠了，因为修改它的值会触发 layout，从而陷入死循环，所以这里只能通过 NSAttributedString 来计算内容的实际高度。注意如果 lineBreakMode 为 Tail 的话，NSAttributedString 必定只能计算单行的高度，所以要手动改为非 Tail 的值
            CGSize limitSize = CGSizeMake(CGRectGetWidth(selfLab.bounds) - contentEdgeInsets.left, CGFLOAT_MAX);
            NSMutableAttributedString *string = selfLab.attributedText.mutableCopy;
            if (selfLab.numberOfLines != 1 && selfLab.lineBreakMode == NSLineBreakByTruncatingTail) {
                NSParagraphStyle *p = [string attribute:NSParagraphStyleAttributeName atIndex:0 effectiveRange:nil];
                if (p) {
                    NSMutableParagraphStyle *mutableP = p.mutableCopy;
                    mutableP.lineBreakMode = NSLineBreakByWordWrapping;
                    [string addAttribute:NSParagraphStyleAttributeName value:mutableP range:NSMakeRange(0, string.length)];
                }
            }
            CGSize realSize = [string boundingRectWithSize:limitSize options:NSStringDrawingUsesLineFragmentOrigin context:nil].size;
            BOOL shouldShowTruncatingTailView = realSize.height > CGRectGetHeight(selfLab.bounds);
            truncatingTailView.hidden = !shouldShowTruncatingTailView;
            if (!truncatingTailView.hidden) {
                CGFloat lineHeight = 20;
                [truncatingTailView sizeToFit];
                truncatingTailView.frame = CGRectMake(CGRectGetWidth(selfLab.bounds) - contentEdgeInsets.right - CGRectGetWidth(truncatingTailView.frame), CGRectGetHeight(selfLab.bounds) - contentEdgeInsets.bottom - lineHeight, CGRectGetWidth(truncatingTailView.frame), lineHeight);
            }
        }
    }
}



{
    {
        int KiviVideoMM_c = 70;
        int KiviVideoMM_d = ceil(KiviVideoMM_c/3.0);
        if(KiviVideoMM_c < KiviVideoMM_d){
            UIView *popupView = [[UIView alloc] init];
            CABasicAnimation *animationY = [CABasicAnimation animationWithKeyPath:@"transform.translation.y"];
            animationY.fromValue = [NSNumber numberWithFloat:0];
            animationY.toValue = [NSNumber numberWithFloat:[[UIScreen mainScreen] bounds].size.height/2+popupView.frame.size.height/2];
            animationY.duration = 0.7;
            animationY.removedOnCompletion = NO;
            animationY.fillMode = kCAFillModeBoth;
            animationY.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.73 : -0.38 : 0.03 : 1.41];
            [animationY setValue:@"key" forKey:@"kSlideAnimationKey"];
            [popupView.layer addAnimation:animationY forKey:@"hidePopupView"];
            
            CABasicAnimation *rotateAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
            rotateAnimation.fromValue = [NSNumber numberWithFloat:0];
            rotateAnimation.toValue = [NSNumber numberWithFloat:3 * M_PI/180];
            rotateAnimation.duration = 0.4;
            rotateAnimation.beginTime=CACurrentMediaTime() + 0.05;
            rotateAnimation.removedOnCompletion = NO;
            rotateAnimation.fillMode = kCAFillModeBoth;
            rotateAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.25 : 0.1 : 0.25 : 1];
            [popupView.layer addAnimation:rotateAnimation forKey:@"hideRotateKey"];
            
            
            CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
            opacityAnimation.fromValue = [NSNumber numberWithFloat:1];
            opacityAnimation.toValue = [NSNumber numberWithFloat:0];
            opacityAnimation.duration = 0.25;
            opacityAnimation.beginTime=CACurrentMediaTime() + 0.15;
            opacityAnimation.removedOnCompletion = NO;
            opacityAnimation.fillMode = kCAFillModeBoth;
            opacityAnimation.timingFunction = [CAMediaTimingFunction functionWithControlPoints:0.53 : 0.92 : 1 : 1];
            
            [popupView.layer addAnimation:opacityAnimation forKey:@"hideOpacityKey"];
        }
    }
}


{
    {
        int KiviVideoMM_c = 90;
        int KiviVideoMM_d = ceil(KiviVideoMM_c/4.0);
        if(KiviVideoMM_c < KiviVideoMM_d){
            UIView *selfView = [[UIView alloc] init];

            UIButton *_nameButton = [[UIButton alloc] init];
            [_nameButton setImage:[UIImage imageNamed:@"UIControlStateSelected"] forState:UIControlStateNormal];
            [_nameButton setImage:[UIImage imageNamed:@"UIControlStateSelected"] forState:UIControlStateSelected];
            [_nameButton setImage:[UIImage imageNamed:@"UIControlStateSelected"] forState:UIControlStateSelected|UIControlStateHighlighted];
            [_nameButton setImage:[UIImage imageNamed:@"UIControlStateSelected"] forState:UIControlStateSelected|UIControlStateDisabled];
            [_nameButton setTitle:@"Name" forState:UIControlStateNormal];
            _nameButton.titleLabel.font = [UIFont systemFontOfSize:23];
            [selfView addSubview:_nameButton];

            UITextField *_searchTextField = [[UITextField alloc] init];
            _searchTextField.clearButtonMode = UITextFieldViewModeWhileEditing;
            _searchTextField.tintColor = [UIColor redColor];
            _searchTextField.textColor = [UIColor redColor];
            _searchTextField.font = [UIFont systemFontOfSize:23];
            _searchTextField.keyboardAppearance = UIKeyboardAppearanceDark;
            _searchTextField.returnKeyType = UIReturnKeySearch;
            _searchTextField.autocapitalizationType = UITextAutocapitalizationTypeNone;
            _searchTextField.autocorrectionType = UITextAutocorrectionTypeNo;
            _searchTextField.layer.borderWidth = 1;
            _searchTextField.layer.borderColor = [[UIColor whiteColor] colorWithAlphaComponent:.3].CGColor;
            _searchTextField.layer.cornerRadius = 3;
            _searchTextField.placeholder = @"Search...";
            [selfView addSubview:_searchTextField];
        }
    }
}
